import request from '@/api/myRequest'
function findArticles(start, limit, data) {
  return request({
    url: `/lejuAdmin/productArticle/findArticles/${start}/${limit}`,
    method: 'post',
    data
  })
}

// 删除文章
function del(id) {
  return request({
    url: `/lejuAdmin/productArticle/del/${id}`,
    method: 'delete'
  })
}

// 更新文章状态
function changeShowStatus(data) {
  return request({
    url: '/lejuAdmin/productArticle/changeShowStatus',
    method: 'post',
    data
  })
}

// 新增文章
function addArticle(data) {
  return request({
    url: '/lejuAdmin/productArticle/addArticle',
    method: 'post',
    data
  })
}

// 更新文章
function updateArticle(data) {
  return request({
    url: '/lejuAdmin/productArticle/updateArticle',
    method: 'post',
    data
  })
}

// 文章明细
function productArticle(id) {
  return request({
    url: `/lejuAdmin/productArticle/productArticle/${id}`,
    method: 'get'
  })
}
export { findArticles, del, changeShowStatus, addArticle, updateArticle, productArticle }
